import { Rule } from 'antd/lib/form';
import { MapT } from "@/utils/map";

export type FormItemType = 'input' | 'select' | 'upload' | 'textArea';

export type Upload = {
  /** 文件最大上传大小 */
  max?: number;
  /** 最多上传几张 */
  maxUpload?: number;
  /** 限制图片类型正则*/
  regExp?: string | RegExp;
  /** 正则提示文案 */
  regMessage?: string;
}

export type FormItem = {
  rules?: Rule[];
  label?: string;
  name: string;
  group?: MapT;
  width?: number;
  upload?: Upload;
  labelCol?: number;
  disabled?: boolean;
  type: FormItemType;
  placeholder?: string;
}
